/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author gzero
 */
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import javax.swing.*;
public class prog{
    
    public static void main (String argv[]) throws IOException, InterruptedException
    {
        gest k = new gest();
        InputStreamReader input = new InputStreamReader(System.in);
        BufferedReader tastiera = new BufferedReader (input);
        System.out.println("download file XML in corso...");
        k.downloadXML();
        System.out.println("lettura file XML in corso...");
        k.leggiXML();
        /* 1 - download/installa manuale
         * 2 - download/installa tutto
         * 3 - vedi lista
         */     
        int scelta=-1;
        while (scelta!=0){
            scelta = k.showMenu();
            switch (scelta){
                case 0:
                    break;
                case 1:
                    k.manInstall();
                    break;
                case 2:                   
                    k.downloadFiles();                   
                    k.startInstall();
                    break;
                case 3:
                    k.showList();
                    break;
                default:
                    System.out.println("errore scelta");
                    break;
            }
        }
        /*k.downloadXML();
        System.out.println("lettura file XML in corso...");
        k.leggiXML();
        System.out.println("---- Inizio Download ----");
        k.downloadFiles();
        System.out.println("---- Fine Download ----");
        k.startInstall();*/
        
    }
}
